package com.yidu.sanrenxing.crudall.service;

import com.yidu.sanrenxing.crudall.domain.Shopping;

import java.util.List;
import java.util.Map;

public interface ShoppingService {
    List<Shopping> selectByUserId(int userid);

    List<Shopping> selectAll();

    int deleteByPrimaryKey(int shoppingid);

    int insert(Shopping record);

    /**
     * 新增购物车信息
     * @param record
     * @return
     */
    int insertSelective(Shopping record);

    Shopping selectByPrimaryKey(int shoppingid);

    int updateByPrimaryKeySelective(Shopping record);

    int updateByPrimaryKey(Shopping record);

    /**
     * 删除指定用户的购物车指定商品
     * @param ComId
     * @param UserId
     * @return
     */
    Integer deleteShoppingCarMsgByComIdAndUserId(Integer ComId,Integer UserId);

    /**
     * 查询指定用户和商品编号是否已经存在
     * @param
     * @return
     */
    Integer queryUserIdAndComIdIfExit(Integer userId,Integer comId);

    /**
     * 增加购物车数量
     * @param shoppingId
     * @param shppingNum
     * @return
     */
    Integer updateShoppingCarById(Integer shoppingId,Integer shppingNum);

}